@ECHO OFF

IF EXIST .\VIPRERescue\SBRE.dll RMDIR /S /Q VIPRERescue
IF EXIST .\7zip.conf DEL /Q 7zip.conf
.\files\wget.exe http://live.sunbeltsoftware.com/download --output-document=VIPREOrig.exe
.\files\7z.exe x -y -oVIPRERescue VIPREOrig.exe
DEL /Q .\VIPRERescue\deep_scan.bat
COPY .\files\*.* .\VIPRERescue
CD VIPRERescue
SET /A FILENAME = %random%
SET /A DIRECTORY = %random%
SET /A SCANFILE = %random%
ECHO [Global] > vpr_dat.ini
ECHO VipreDirectory=%DIRECTORY% >> vpr_dat.ini
ECHO VipreProgramName=%FILENAME%.exe >> vpr_dat.ini
ECHO VipreGUIName=%SCANFILE%.exe >> vpr_dat.ini
REN VIPRERescueScanner.exe %FILENAME%.exe
REN VipreScanner.exe %SCANFILE%.exe
..\files\7z.exe a -r -t7z -m0=lzma VipreScanner.7z *
COPY VipreScanner.7z ..
CD ..
ECHO ;!@Install@!UTF-8!> 7zip.conf
ECHO Title="Vipre Command-Line Virus Scanner">> 7zip.conf
ECHO ExecuteFile="%SCANFILE%.exe">> 7zip.conf
ECHO ;!@InstallEnd@!>> 7zip.conf
pause
COPY /B 7zS.sfx + 7zip.conf + VipreScanner.7z VipreRescue.exe
DEL /Q 7zip.conf
DEL /Q VIPREOrig.exe
DEL /Q VIPREScanner.7z
RMDIR /S /Q VIPRERescue
